<?php
	defined('_JEXEC') or die('Restricted access');
    
   
	//
	// t_base_action
	//
	abstract class t_base_action implements i_base_action 
	//abstract class t_base_action
	{
		// property declaration
		// protected
		
        // property declaration
		// private
		 
		// property declaration
		// public

		// C
        public $childs_index = -1;
        public $childs_actions_list = array();
		const common_properties_position_per_main_action_name = 0;
        const common_properties_position_per_action_type = 1;
        const common_properties_position_per_action_name = 2;
		const common_properties_position_per_field_list = 3;
        const common_properties_position_last = 4;
        public $current_step_index = -1;
        // D
        const default_field_value = 'default';
        const do_action_from_ajax = 'do_action_from_ajax';
        const do_action_from_no_ajax = 'do_action_from_no_ajax';
		// F
		public $force_executable = false;		
		// H
		public $hashed_name = '';
		// I
		public $initialized = false;
		// L
        // L
		public $lang = array();
		public $level = 0;
        // M
        public $main_action = null;
        // P
        public $parent_component = null;
		public $parent_part = null;
        // source type
		const source_type_custom_script = 'source_custom_script';
		const source_type_custom_value = 'source_custom_value';
        const source_type_db = 'source_type_db';
        const source_type_field = 'source_type_field';
        const source_type_main_action_db = 'source_type_main_action_db';
        const source_type_main_action_field = 'source_type_main_action_field';
		// S
		const step_start = 0;
		const step_criteria = 1;
		const step_result = 2;
		const step_finalize = 3;
		// property declaration
		// protected
        // C
        protected $common_properties_array = array();
		protected $content_loader = null;
       
        // F
        protected $fields_list = array();
        // P
        protected $proper_properties_array = array();
		// S
        protected $steps_list = array();


		// method declaration
		// private

        
        // method declaration
		// protected    

		
        // C
        abstract protected function custom_execute_step($a_step);        
        // E
		protected function execute_child_ations($a_result,$a_connection,$a_query_query = null)
		{
			//echo "execute_child_ations<br>";
			// check is there some actions to execute at end of current action execution
			$local_actions_array = $this->is_there_child_action_class(array('t_action_execute_query',
				't_action_send_mail_from_query','t_action_custom_code','t_action_put_into_parameter',
				't_action_file_get_contents')); 
			
			foreach ($local_actions_array as $local_action) 
			{
				//echo "action name: ".$local_action->get_action_name()." - a_result->succeeded: ".$a_result->succeeded."<br>";
				if (! $a_result->succeeded)
					break;
				else
				{
					// execute child action
					$local_action->do_action_from_ajax($a_result,$a_connection->connection,$a_query_query);
				}	
			}
		}	
		
		/*
			EXECUTES STEPS OF ACTIONS FRO A DEFAULT EXECUTIN
		*/
        protected function execute_step($a_step)        
        {
            
			global $g_cuteengine;
            if (!isset($a_step))
			{
                // SKIPS STEP EXECUTION IF STEP IS NOT SPECIFIED
				return;
			}
		//	echo __METHOD__."this->current_step_index: $this->current_step_index<br>";
			//echo "action_name:".$this->get_action_name()."<br>";
            /*childs code*/
			$local_childs_actions_code = '';
			if ($this->has_childs_actions())
			{
				// RETRIVES CHILDS ACTIONS CODE
				$local_childs_actions_code .= $this->get_childs_actions_code($a_query_parameter,$a_current_row_no,$a_rows_count);
				//echo "action_name:".$this->get_action_name()." - local_childs_actions_code:$local_childs_actions_code<br>";
			}
			//
			// FIELD BELONG STEP
			$local_field = $a_step->field;
			//echo "local_field->name:".$local_field->name."<br>";
            $local_field_class = get_class($a_step->field);
			if (isset($local_field))
			{
				$local_start_tag = $local_field->get_start_tag();
				$local_result_tag = $local_field->get_result_tag();
			}	
            else
            {
                $local_start_tag = '';
				$local_result_tag = '';                
            }
			// GETS NEXT STEPS
            $local_next_step = $this->steps_list[$this->current_step_index + 1];
			//CLASS OF CURRENT STEP
            $local_step_class = get_class($a_step);
			//CLASS OF CURRENT STEP
            $local_action_class = get_class($this);
           // echo "execute_step - action_name:" . $this->get_action_name() ." - a_step: ".$a_step->name."($local_step_class) - local_field: ".$local_field->name."<BR>";
            //echo "local_step_class: $local_step_class<br>";
			switch ($local_step_class) 
            {
                /*********** t_step_ajax_get ***********/
                case t_step_ajax_get:
                    if ($local_field_class === t_field_grid)
                    {
                        $a_step->code ="if ((typeof local_target != 'undefined') && (local_target.checked)) {var local_argoument = a_key;} else {var local_argoument = null;}";
                        $a_step->code .="
    ".$this->get_content_loader_code($local_next_step->code);
						//echo "execute_step - action_name:" . $this->get_action_name() ." - a_step->code: $a_step->code<br>";

                    }
                    else
                    {
                        $a_step->code = "
    var local_target = event.target ? event.target : event.srcElement;";
                        if ($local_start_tag !== '')
                        {
                            $a_step->code .= "
    var local_argoument = this.html_tag('".$local_start_tag->name."').keys;";
                        }
                        $a_step->code .="
            ".$this->get_content_loader_code($local_next_step->code);                        
                    }
                    

                break;	
				/*********** t_step_ajax_display ***********/
                case t_step_ajax_display:
					$a_step->code = $local_result_tag->name;
                break;				
                /*********** t_step_ajax_put ***********/
                case t_step_ajax_put:
                    /*$local_prev_step = $this->steps_list[$this->current_step_index - 1];
                    print_r($local_prev_step);
                    if (isset($local_prev_step))
                    {   
                        $local_field = $g_cuteengine->fields_list[$local_prev_step->get_field_name()];
                        $local_start_tag = $local_field->get_start_tag();
                        $local_prev_step_code = "this.html_tag('".$local_start_tag->name."').innerHTML = ''";
                    }
                    else
                        $local_prev_step_code = '';*/
                    
                    /*$this->add_do_action_as_method('list_item_selected','event,a_key_str,a_labels_str',"
        $local_prev_step_code
        this.html_tag('".$local_result_tag->name."').keys = a_key_str;
        this.html_tag('".$local_result_tag->name."').value = a_labels_str;
        $local_next_step->code
        "); */
                break;		
                /*********** t_step_ajax_start ***********/
                case t_step_ajax_start:	
					//echo "local_field_class: $local_field_class <br>";
                    if (($local_field_class === t_field_grid) || ($local_field_class === t_field_processes_engine))
                    {
                        $a_step->code = $local_next_step->code;
                    }    
                    else   
                    {
                        if ($this->is_main_action())
						{
							$this->add_do_action_as_event($local_field,$this->get_action_name().'_start_ajax','',"
        ".            
                            $local_next_step->code .
        "");
						}
                    }
                break;   
				/********** t_step_set_ce_field_event *********/
				case t_step_set_ce_field_event:
				//echo "action_name: ".$this->get_action_name()." - local_childs_actions_code: $local_childs_actions_code <br>"; 
					$local_field->add_event($this->get_event_type(), $this->get_event_name(),
						$local_childs_actions_code);
								
				break;			
                /*********** t_step_set_ce_tag_content ***********/
                case t_step_set_ce_tag_content:
                    
                    ob_start();                   
                    try
                    {
                        
						$this->do_action_from_ajax();
						$local_result_tag->add_text_to_include(trim(ob_get_contents())); 
                    }
                    catch (Exception $e) 
                    {
                        $g_cuteengine->log->add_log_error($e->getMessage());
                    } 
					ob_end_clean();
                   
                break;                      
                /*********** t_step_set_html_tag_property ***********/
                case t_step_set_html_tag_property:
                    $a_step->code = "this.html_tag(\"".$local_start_tag->name."\").".$a_step->get_property_name()." = ".$a_step->get_new_value().";"; 
                break;                      
            }
           // echo "execute_step OK <BR>";
        }      
        // I
        protected function initialize_action()
        {		
			
			$this->initialized = false;
			if (! $this->initialized)
			{

   

			}
			return $this->initialized;
		}
		abstract protected function initialize_step_execution();
        protected function initialize_steps_execution()
		{
			// STEPS
            //echo "this->get_action_name(): ". $this->get_action_name() ."<br>";
			for($local_index = count($this->steps_list)-1; $local_index >= 0; $local_index--)
			{
				$this->current_step_index = $local_index;
				//echo "this->current_step_index: $this->current_step_index<br>";
				$local_step = $this->steps_list[$this->current_step_index];
				$local_field = $this->fields_list[$local_index];
				if ($local_field == self::default_field_value)
                {
                    //echo "local_field: $local_field<br>";
					$local_field = $this->parent_part->get_field_by_step($local_step);
                   // echo "get_field_by_step result: local_field->name: " . $local_field->name ."<br>";
					$local_step->set_field_name($local_field->name );
                    $this->fields_list[$local_index] = $local_field->name; 
                }   
				$this->initialize_step_execution();
			}
				
			
		}
		// G
        abstract protected function get_proper_properties_position_last();
        abstract protected function get_required_fields_count();
        protected function load_language()
		{
            global $g_ambient_namespace;
            $g_ambient_namespace->load_language($this);
        }

        // method declaration
		// public        
		public function __construct($a_parent_component,$a_parent_part,$a_common_properties_str, $a_proper_properties_str) 
		{
            global $g_cuteengine;
            global $g_strings_utility_namespace;
			global $g_ambient_namespace;
            /* COMMON PROPERTIES */
            //echo "a_parent_component->name: $a_parent_component->name <br>";
			$this->parent_component = $a_parent_component;
            //print_r($this->parent_component->content_loader);
            if ($a_parent_part == null)
                $this->parent_part = $this->parent_component->get_first_part();
            else
                $this->parent_part = $a_parent_part;
            //echo "a_common_properties_str: $a_common_properties_str<br>";
			$this->common_properties_array = $g_strings_utility_namespace->check_json_string_parameters(
				$this,"",t_query_parameter::separator_level_1,$a_common_properties_str,
				self::common_properties_position_last,'COMMON PROPERTIES');
                
            /* PROPER PROPERTIES  */
			$this->proper_properties_array = self::parse_proper_properties($this,$this->get_action_name(),t_query_parameter::separator_level_1,$g_strings_utility_namespace->get_disguised_separator($a_proper_properties_str),
				$this->get_proper_properties_position_last(),'PROPER PROPERTIES');

            // FIELDS
			//echo "fields: ". $this->common_properties_array[self::common_properties_position_per_field_list]."<br>";
            //$local_fields_list = $g_strings_utility_namespace->check_string_parameters(
			$this->fields_list = $g_strings_utility_namespace->check_json_string_parameters(
				$this,$this->get_action_name(),t_strings_utility_namespace::separator_level_2,
                /*json_encode(*/$this->common_properties_array[self::common_properties_position_per_field_list]/*)*/,
				$this->get_required_fields_count(),'FIELDS');
			$this->hashed_name = md5($this->get_action_name());
			/* LANGUAGES  */
			$this->load_language();
            // mai action
			$local_main_action_name = $this->common_properties_array[self::common_properties_position_per_main_action_name];  
			//echo "this->get_action_name(): ". $this->get_action_name() ." - local_main_action_name: $local_main_action_name <br>";
			if ($local_main_action_name === 'none')
			{
				$this->main_action = null;
				$this->level = 0;
			}	
			else
			{
                $this->set_main_action($local_main_action_name);
			}
			// VARIOUS
            
            //print_r($this->parent_component->content_loader);
            $this->content_loader = $this->parent_component->content_loader;
            
            //echo "this->name: ".$this->get_action_name() . "<br>"; 
			
			//echo "content_loader ASSEGNATO<br>";
            
		}
        
		//A
		public function add_child_action($a_action)
		{
			$this->childs_actions_list[] = $a_action;
			//echo "parent_action: ".$this->get_action_name()." - child action: ".$a_action->get_action_name()."<br>";
			return (count($this->childs_actions_list)-1);
		}

       
		public function add_do_action_as_event($a_field,$a_method_name,$a_arguments,
			$a_body_method)
        {
            global $g_javascript_namespace;
            //    
            if ($a_arguments == '')
				$local_arguments = 'event';
			else	
			    $local_arguments = 'event,'.$a_arguments;
			//  
            //echo "a_field->name: ".$a_field->name."<br>";
			//echo "this->get_action_name: ".$this->get_action_name()."<br>";
            $g_javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
                get_class($this->parent_component),$a_method_name,$local_arguments,$a_body_method);					
            $local_tag = $a_field->get_start_tag();
            //echo "action_name:" . $this->get_action_name() ." - local_tag: ".$local_tag->name."<BR>";
            //echo "start_tag: ".$local_tag->name ." - local_tag->base_tag_type: $local_tag->base_tag_type<BR>";
			if ($local_tag->base_tag_type == t_base_tag_type::btt_button)
				$local_javascript_event = 'onclick';
			else
				$local_javascript_event = 'onkeydown';
            $local_tag->add_event_as_local_method($local_tag->name,$local_javascript_event,
				$a_method_name,$this->parent_component->delayed_position);    
                
        }
		
        public function add_do_action_as_method($a_method_name,$a_arguments,$a_body_method)
        {
            global $g_javascript_namespace;
            
			//	
			$g_javascript_namespace->header_script_generator->add_method_to_a_class_with_content(
                get_class($this->parent_component),$a_method_name,$a_arguments,$a_body_method);					
                
        }		
		
		public static function apply_query_parameter_by_name($a_query,$a_parameters_array,$a_parameters_names)
        {
			$local_invalid_value_list = '';
			$a_query->reset_parameters();

			
			//print_r($a_parameters_array);
			foreach ($a_parameters_names as $local_parameter_name_index=>$local_parameter_name) 
			{
				//echo "local_parameter_name: $local_parameter_name ";
                $local_db_field_index = $a_query->get_parameter_index_by_name($local_parameter_name);
				if ($local_db_field_index >= -1)
				{
					//echo "index: $local_db_field_index - value:".$a_parameters_array[$local_parameter_name_index];
					$a_query->set_value_parameter(
						$a_parameters_array[$local_parameter_name_index],$local_db_field_index);
					
					if ($a_query->is_not_correct_value($local_db_field,$a_parameters_array[$local_parameter_name_index],$local_db_field_index))
						if($local_invalid_value_list == '')
							$local_invalid_value_list = "Fields values ivalid for: `$local_db_field->name`";
						else
							$local_invalid_value_list .= ", `$local_db_field->name`";
				}			
			}
			return $local_invalid_value_list;
		}
        public static function create_action_from_string($a_parent_component,$a_parent_part,$a_action_str)
        {
            //echo "a_action_str: $a_action_str<br>";
            global $g_cuteengine;
            global $g_ambient_namespace;
			global $g_strings_utility_namespace;
            //global $g_cuteengine_actions_list;
			$local_action = null;
			$local_action_properties = $g_strings_utility_namespace->check_json_string_parameters(
				$this,"",t_query_parameter::separator_level_1,$a_action_str,
				0,'PROPERTIES',true);
			$local_common_properties = /*json_encode(*/array_slice($local_action_properties,0,self::common_properties_position_last)/*)*/;	
			$local_proper_properties = /*json_encode(*/array_slice($local_action_properties, self::common_properties_position_last)/*)*/;

            //
			$local_class_type = $local_action_properties[self::common_properties_position_per_action_type];  
            $local_name = $local_action_properties[self::common_properties_position_per_action_name]; 			 	
			$local_file_name = substr($local_class_type,2,strlen($local_class_type));
            $local_path = CUTEENGINE_ACTIONS_PATH. $local_file_name . DIRECTORY_SEPARATOR  ;
            //echo "$local_path$local_file_name.php <br>";   
			//echo "local_name: $local_name<br>";
            if (file_exists("$local_path$local_file_name.php"))
            {      
                if (!array_key_exists (md5($local_name), $g_cuteengine->actions_list))
				{					
					require_once("$local_path$local_file_name.php"); 
					//echo "local_class_type:" .$local_class_type."<br>"; 
                    $g_ambient_namespace_autoload_content = 'actions_content';
					$local_action = new $local_class_type($a_parent_component,$a_parent_part,
						$local_common_properties,$local_proper_properties);	        
					$g_cuteengine->actions_list[$local_action->hashed_name] = $local_action;
					//echo "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&";
					//print_r($local_action);					
				}
				else
				{
					 throw new Exception('Error, action name '.$local_name.' already exist.');
				}
            } 
			else
			{
				 throw new Exception('Error action class '.$local_class_type.'. Class file not found.');
			} 
            
			return $local_action;
        }	
        // D
        public function do_action_from_ajax()
        {
            global $g_url_parameters_namespace;
			$local_param = $g_url_parameters_namespace->get_parameter_by_component_id($this->parent_component->id); 
            if (isset($local_param) and (trim($local_param->argument) != ''))
				return $g_url_parameters_namespace->get_parameter_by_component_id($this->parent_component->id); 
			else
				return $g_url_parameters_namespace->get_parameter_by_position(0); 
			
        }
        public function do_action_from_no_ajax()
        {
            //echo "do_action OK";
        }		
        // I
        public function initialize()
		{
			$local_main_action_name = $this->common_properties_array[self::common_properties_position_per_main_action_name];  
			//echo "this->get_action_name(): ". $this->get_action_name() ." - local_main_action_name: $local_main_action_name <br>";
			if ($local_main_action_name !== 'none')
			{
                $this->set_main_action($local_main_action_name);
			}
			//echo "initialize action ".$this->get_action_name()."<BR>";
            $this->initialize_action();
            //echo "this->initialize_action(); OK<BR>";
			//$local_action_event = $this->get_first_parent_action_class("t_action_set_event_part");
           // if (!$this->is_body_event_action())
			//{
                $this->initialize_steps_execution();
            //}    
           // echo "this->initialize_steps_execution OK<BR>";
		}
			

		//G
		public function get_action_name()
		{
			$local_action_name = $this->common_properties_array[self::common_properties_position_per_action_name];   
            return $local_action_name;
		}        
		public function get_action_steps_code()
        {
			$local_return = '';
			
            if ($this->parent_part->has_parent_part())
            {
                /*  step_start  */   
                $local_return = $this->steps_list[t_base_action::step_start]->code;
            }
			else if (($this->fields_list[t_base_action::step_start] != '') ||
			  ($this->steps_list[t_base_action::step_start]->code != ''))
			{
                /*  step_start  */   
                $local_return = $this->steps_list[t_base_action::step_start]->code;
            }        
            else
            {
                /*  step_result  */   
                $local_return = $this->steps_list[t_base_action::step_result]->code;
            }
			//echo "this->get_action_name(): " .$this->get_action_name()." - local_return: $local_return - this->steps_list[t_base_action::step_start]->code: ".$this->steps_list[t_base_action::step_start]->code."<br>"; 
            return $local_return;        
		}
		
		public function get_action_type()
		{
			
			return $this->common_properties_array[self::common_properties_position_per_action_type];  
		}
		
		public function get_childs_actions_code()
		{
			$local_return = ''; 
			
            foreach ($this->childs_actions_list as $local_action) 
			{
				$local_return .= $local_action->get_action_steps_code();
			}
			return $local_return;
			
		}
			
        
		public function get_content_loader_code($a_result_script,$a_post = true,
            $a_use_action_name = false)
        {
            //echo "a_result_script: $a_result_script<br>";
            global $g_cuteengine;
			global $g_javascript_namespace;
            //
            if ($a_post)
                $local_post = "'POST'";
            else
                $local_post = "'GET'";
            //    
            if ($a_use_action_name)   
                $local_action_name = $this->hashed_name;
            else
                $local_action_name = "'+local_action_name+'";            
            //
            $local_parameters_list = new t_url_parameters_list(false);
            // It will execute do_action method on t_cuteengine class
            $local_parameter = $local_parameters_list->add_new_parameter(
                $g_cuteengine->id,'do_action',
                "@$local_action_name@'+local_argoument+'",
                t_url_parameter::request_type_no_page);	
            //    
			if (isset($this->content_loader))
				$local_content_loader = $this->content_loader;
			else
				$local_content_loader = $g_javascript_namespace->content_loader;
            return "
                if (typeof local_argoument == 'undefined')  
                    local_argoument = '';
                else
                    local_argoument = local_argoument +'@';    
                ".$local_content_loader->add_execute_javascript_code('this.content_loader',
				$local_parameters_list,'true',
				$local_post ,'this.log_componet_name',$a_result_script);
        }
        public function get_first_field_name()
        {
            foreach ($this->fields_list as $local_field_index => $local_field_name)
            { 
                if ($local_field_name != '')
                {
                    return $local_field_name; 
                }
            }
        }
		public function get_first_parent_action_class($a_action_class)
		{
			//echo"a_action_class:$a_action_class<br>";
			if (!$this->is_main_action())
			{	
				
				//echo"get_class(this->main_action):".get_class($this->main_action)."<br>";
				if (get_class($this->main_action) == $a_action_class)
				{
					return $this->main_action;
				}	
				else
					return $this->main_action->get_first_parent_action_class($a_action_class);
			}
			else 
				return null;		
		}
		
		// G
		public function get_lang_count()
        {
            return (count($this->lang));
        }
		abstract public function get_language_position_last();
		
		static function get_proper_properties_help($a_index)
		{	
			$local_return = '';
			for ($i=0; $i < $this->get_proper_properties_position_last(); $i++)
			{
				if ($local_return == '')
					$local_return = $this::get_help_proper_property($i);
				else
					$local_return .= ", ".$this::get_help_proper_property($i);
				
			}
		}
		
		static function get_default_value_proper_properties($a_index)
		{	
			$local_return = '';
			for ($i=0; $i < $this->get_proper_properties_position_last(); $i++)
			{
				if ($local_return == '')
					$local_return = $this::get_default_proper_property($i);
				else
					$local_return .= ", ".$this::get_default_proper_property($i);
				
			}
		}
		// H
		public function has_childs_actions()
		{
			return (count($this->childs_actions_list) > 0);
			
		}

		// I
		public function is_child_action()
		{
			
			return ($this->main_action != null);
		} 	
		
		public function is_there_child_action_class($a_action_class_array)
		{
			//echo "parent_action: ".$this->get_action_name();
			
			//echo count($this->childs_actions_list);
			$local_return = array(); 
			
            foreach ($this->childs_actions_list as $local_action) 
			{
				foreach ($a_action_class_array as $local_class) 
				{
				    
					 // echo 'get_class($local_action): '. get_class($local_action)." - local_class $local_class<br>";
					if (get_class($local_action) == $local_class)
					{
						//echo "azione aggiunta: ".$this->get_action_name()."<br>";
						$local_return[] = $local_action;
					}
				}	
			}
			return $local_return;	
		}		
		
		public function is_body_event_action()
		{
            return (get_class($this->main_action) == t_action_set_event_part );
		}          
		public function is_field_of_class($a_local_field, $a_field_class)
		{
			$local_field_class = get_class($a_local_field);
			return ($a_field_class == $local_field_class);
		} 		
        public function is_main_action()
		{
			
			return ($this->main_action == null);
		}        
		public function is_executable()
		{
			return true;
		}
		public function are_permissions_done()
		{	
			return true;
		}
		// P 
		public static function parse_proper_properties($a_obj,$a_name,
			$a_separator_char,$a_string_parameters, $a_last_position,
			$a_error_label)
		{
			global $g_strings_utility_namespace;
			
		    $local_actions_array = $g_strings_utility_namespace->check_json_string_parameters(
				$a_obj,$a_name,$a_separator_char,$a_string_parameters,
				$a_last_position,$a_error_label,true);
			//print_r($local_actions_array);
			//echo "count: " . (count($local_actions_array)) ." - last: ". $a_last_position ."<br>";
			if ((count($local_actions_array)) < ($a_last_position))
			{	
				//echo "count: " . (count($local_actions_array)) ." - last: ". $a_last_position ."<br>";
				// add default values
				   for($local_index = (count($local_actions_array)); $local_index < $a_last_position; $local_index++)
				   {
						//echo "local_index: $local_index<br>";
						$local_actions_array[$local_index] = $a_obj::get_default_proper_property($local_index);
						//echo "local_actions_array[$local_index]: ". $local_actions_array[$local_index]."<br>"; 
				   }
				   
			}						
			return  $local_actions_array;	
		}
        // S
        public function set_main_action($a_main_action_name)
        {
            global $g_cuteengine;
            //global $g_cuteengine_actions_list;
            if (! isset($this->main_action))
            {
                //echo "a_main_action_name:$a_main_action_name<br>";
				$this->main_action = $g_cuteengine->actions_list[md5($a_main_action_name)];
               // echo "action_type: ". $this->get_action_type() ."<br>";
                $this->childs_index = $this->main_action->add_child_action($this);
                $this->level = $this->main_action->level + 1;        
            }    
        }        
	}
	
	interface i_base_action {
		static function get_default_proper_property($a_index);
		static function get_help_proper_property($a_index);
	}  
?>